package com.soft.cqlinglong.oto.impl.permission;/**
 * Created by huangxueqian on 2017/6/4/004.
 */

import com.alibaba.fastjson.JSON;
import com.soft.cqlinglong.oto.dao.mapper.TSMenuMapper;
import com.soft.cqlinglong.oto.dao.model.TSMenu;
import com.soft.cqlinglong.oto.dao.model.TSUser;
import com.soft.cqlinglong.oto.service.permission.TSMenuService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 菜单服务层
 *
 * @author 黄学乾 778142659@qq.com
 * @create 2017-06-04 17:11
 **/
@Service
public class TSMenuServiceImpl implements TSMenuService {
    public Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired(required = false)
    private TSMenuMapper tsMenuMapper ;

    public Integer saveTSMenu(TSMenu tsMenu) throws Exception {
        return null;
    }

    public TSMenu findTSMenu(String menuId) throws Exception {
        return tsMenuMapper.selectByPrimaryKey(menuId);
    }

    public List<TSMenu> queryTSMenuList(TSUser tsUser) throws Exception {
        logger.info("queryTSMenuList-->start"+ JSON.toJSONString(tsUser));
        //List<TSMenu> tsMenuList = new ArrayList<TSMenu>();
        List<TSMenu> tsMenuList = tsMenuMapper.queryTSMenuList(tsUser);
        logger.info("queryTSMenuList-->end"+ JSON.toJSONString(tsUser));
        return tsMenuList ;
    }
}
